var _o21;
var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2GameUser = require("GameUser");
var $2ServerConfig = require("ServerConfig");
var $2Platformconf = require("Platformconf");
var $2ObjUtil = require("ObjUtil");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_GameEvent = _o21 = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
  }
  return babel_createClass(_ctor, null, [{
    key: "posMsg",
    value: function posMsg(e, t, n) {
      if (window.tt && $2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.TTGame) {
        window.tt.eqSendEvent(e, t, n);
      } else if ($2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.WXGame) {
        null == t ? t = {
          loginTime: $2GameUser.default.getInstance().countDay,
          sysos: cc.sys.os
        } : $2ObjUtil.default.isObject(t) ? (t.loginTime = $2GameUser.default.getInstance().countDay, t.sysos = cc.sys.os) : t = {
          value: t,
          loginTime: $2GameUser.default.getInstance().countDay,
          sysos: cc.sys.os
        }, window.wx.eqSendEvent(e, t, n);
      }
    }
  }, {
    key: "wxqeSendEvent",
    value: function wxqeSendEvent(e, t, n) {
      $2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.WXGame && window.wx && window.wx.eqSendEvent && window.wx.eqSendEvent(e, t, function (e) {
        console.log("vlez--> wx服务器请求成功，获取的数据：", e);
        if (e) {
          n && n(e);
        } else {
          console.error("请求服务器数据失败");
        }
      });
    }
  }, {
    key: "ttSendEvent",
    value: function ttSendEvent(e, t, n) {
      window.tt && $2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.TTGame && window.tt.eqSendEvent(e, t, function (e) {
        console.log("vlez--> tt服务器请求成功，获取的数据：", e);
        if (e) {
          n && n(e);
        } else {
          console.error("请求服务器数据失败");
        }
      });
    }
  }, {
    key: "kwaiSendEvent",
    value: function kwaiSendEvent(e, t, n) {
      $2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.KWaiGame && window.ks && window.ks.eqSendEvent && window.ks.eqSendEvent(e, t, function (e) {
        console.log("vlez--> ks服务器请求成功，获取的数据：", e);
        if (e) {
          n && n(e);
        } else {
          console.error("请求服务器数据失败");
        }
      });
    }
  }, {
    key: "wxSendEvent",
    value: function wxSendEvent(e, t) {
      $2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.WXGame && window.wx.reportUserBehaviorBranchAnalytics({
        branchId: e,
        branchDim: t && t,
        eventType: 2
      });
    }
  }, {
    key: "sendEvent",
    value: function sendEvent(e, t, n) {
      var _o22 = $2ServerConfig.default.getInstance().gameconfig.config.event_pointopen;
      console.log("sendEvent____confg", _o22);
      "savedata" == e && window.tt.eqSaveData && window.tt.eqSaveData(t, n);
      "getdata" == e && window.tt.eqGetData && window.tt.eqGetData(t, n);
      if ($2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.TTGame) {
        this.ttSendEvent(e, t, n);
      } else if ($2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.WXGame) {
        this.wxqeSendEvent(e, t, n);
      } else {
        $2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.KWaiGame && this.kwaiSendEvent(e, t, n);
      }
    }
  }, {
    key: "setuserinfo",
    value: function setuserinfo(e) {
      if ($2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.KWaiGame && window.kwaigame && window.kwaigame.eqapi) {
        window.kwaigame.eqapi.setuserinfo(e);
      } else if ($2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.TTGame && window.tt && window.tt.eqapi) {
        window.tt.eqapi.setuserinfo(e);
      } else if ($2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.WXGame && window.wx && window.wx.eqapi) {
        window.wx.eqapi.setuserinfo(e);
      } else {
        $2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.OPPOGame && window.qg && window.qg.eqapi && window.qg.eqapi.setuserinfo(e);
      }
    }
  }, {
    key: "eqGetToken",
    value: function eqGetToken(e) {
      $2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.KWaiGame || $2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.TTGame && (console.log("eqGetToken", window.tt.eqSendEvent), window.tt.eqSendEvent("getToken"), window.tt.eqapi.getToken = function (t) {
        console.log("getToken", t);
        e(t);
      });
    }
  }, {
    key: "userLogin",
    value: function userLogin() {}
  }, {
    key: "userSeeVideoData",
    value: function userSeeVideoData(e, t) {
      var n = 0;
      for (var _i3 = 0; _i3 < _o21.videoNames.length; _i3++) {
        e == _o21.videoNames[_i3] && (n = _i3 + 1);
      }
    }
  }, {
    key: "userGameEnd",
    value: function userGameEnd(e) {}
  }, {
    key: "ttGetLaunchOptionsSync",
    value: function ttGetLaunchOptionsSync() {
      var e = window.tt.getLaunchOptionsSync();
      console.log("ttGetLaunchOptionsSync:" + e);
      _o21.scene = e.scene;
      _o21.query = e;
    }
  }, {
    key: "ttgetSystemInfo",
    value: function ttgetSystemInfo() {
      window.tt.getSystemInfo({
        success(e) {
          console.log("ttgetSystemInfo:" + e);
          _o21.ttSystemInfo = e;
        },
        fail(e) {
          console.log("getSystemInfo 调用失败");
        }
      });
    }
  }, {
    key: "ttRequest",
    value: function ttRequest(e) {
      window.tt.request(e);
    }
  }]);
}();
def_GameEvent.msgList = [];
def_GameEvent.urlStrs = ["https://xazx.eqmobi.com/api/user/deviceLogin", "https://xazx.eqmobi.com/api/adv/played", "https://xazx.eqmobi.com/api/game/start", "https://xazx.eqmobi.com/api/game/over"];
def_GameEvent.videoNames = ["add_time_zhudong", "add_time_beidong", "complete_level_tip", "complete_level_answer", "complete_unlock_level", "complete_level_unlock_all", "levelPlayAD", "jump_level", "tuijian_level"];
def_GameEvent.scene = null;
def_GameEvent.query = null;
def_GameEvent.ttSystemInfo = null;
def_GameEvent = _o21 = cc__decorate([ccp_ccclass("GameEvent")], def_GameEvent);
exports.default = def_GameEvent;